package com.syni.mdd.yhd.common.all.entity;

import com.syni.mdd.yhd.common.all.constants.Constants;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @className BaseEntity
 * @description TOO
 * @Author cfx
 * @DATE 2019/7/18 11:45
 * @VERSION 1.0
 **/
@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class BaseEntity {
    @CreatedDate
    @Column(name = "new_time")
    @Temporal(TemporalType.TIMESTAMP)
    private Date newTime;

    @LastModifiedDate
    @Column(name = "update_time")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;

    @Column(name = "is_delete")
    private Integer isDelete = 0;

}
